import {
    createChunck
} from '@/libs/tools'


onmessage = async(e)=>{
    console.log('e',e.data);
    const proms = [];
    const {file,CHUNCK_SIZE,startIndex,endIndex } = e.data;
    for(let i = startIndex;i<endIndex;i++){
         proms.push(createChunck(file,i,CHUNCK_SIZE )) 
    }
    const chuncks = await Promise.all(proms);
    postMessage(chuncks);
} 